#ifndef MAP_H__
#define MAP_H__

#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <vector>

#define X_BLOCK_NUM     13
#define Y_BLOCK_NUM     13
#define BLOCK_WIDTH     32
#define BLOCK_HEIGHT    32

class mapResource
{
private:
    std::vector<SDL_Texture*> texture;
public:

    int xPos, yPos;
    int initResource(SDL_Renderer*);
    int renderMap(SDL_Renderer*);
    int isCollisions(SDL_Keycode);
};

// 0 黄钥匙 1 蓝钥匙 2 红钥匙 3 地面 4 墙 5 黄色的门 6 蓝色的门 7 红色的门 8 红宝石 9 蓝宝石 10 绿宝石 11 红药水 12 蓝药水 13 黄药水 14 绿药水
// 15 人物 16 上一层楼台阶 17 下一层楼台阶
int floor_1[13][13] = {
    {4, 3,  3,  3,  3, 16, 3, 3, 3, 3, 4, 3,  4},
    {4, 10, 10, 10, 4, 3,  4, 0, 0, 0, 4, 11, 4},
    {4, 10, 10, 10, 7, 3,  7, 0, 0, 0, 7, 11, 4},
    {4, 10, 10, 10, 4, 3,  4, 0, 0, 0, 4, 11, 4},
    {4, 4,  6,  4,  4, 3,  4, 4, 6, 4, 4, 12, 4},
    {4, 9,  9,  9,  4, 3,  4, 1, 1, 1, 4, 12, 4},
    {4, 9,  9,  9,  7, 3,  7, 1, 1, 1, 7, 12, 4},
    {4, 9,  9,  9,  4, 3,  4, 1, 1, 1, 4, 13, 4},
    {4, 4,  5,  4,  4, 3,  4, 4, 6, 4, 4, 13, 4},
    {4, 8,  8,  8,  4, 3,  4, 2, 2, 2, 4, 14, 4},
    {4, 8,  8,  8,  7, 3,  7, 2, 2, 2, 7, 14, 4},
    {4, 8,  8,  8,  4, 3,  4, 2, 2, 2, 4, 14, 4},
    {4, 4,  4,  4,  4, 17, 4, 4, 4, 4, 4, 4,  4},
};

#endif